<template>
  <el-row :gutter="40" class="panel-group">
    <el-carousel :autoplay="false" trigger="click" height="250px">
      <el-carousel-item>
        <!-- <img src="@/assets/day/none.png" alt="" style="width: 100%;height: 100%;object-fit: contain;"
          v-show="biNumberItem.length <= 0"> -->
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('销售金额') }"
            @click="handleSetLineChartData('销售金额')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                销售金额
                <el-tooltip
                  :content="'销售金额'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>
              <!-- <div v-if="biNumberOfItem == null">未更新</div> v-else-->

              <div class="card-panel-num">
                {{ itemData.salesAmount ? itemData.salesAmount : "未更新" }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('退款金额') }"
            @click="handleSetLineChartData('退款金额')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                退款金额
                <el-tooltip
                  :content="'退款金额'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>
              <!-- <div v-if="biNumberOfItem == null">未更新</div> v-else-->

              <div class="card-panel-num">
                {{ itemData.returnAmount ? itemData.returnAmount : "未更新" }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('净销售额') }"
            @click="handleSetLineChartData('净销售额')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                净销售额
                <el-tooltip
                  :content="'净销售额'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>
              <!-- <div v-if="biNumberOfItem == null">未更新</div> v-else-->

              <div class="card-panel-num">
                {{
                  itemData.netSalesAmount ? itemData.netSalesAmount : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('综合退货率') }"
            @click="handleSetLineChartData('综合退货率')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                综合退货率
                <el-tooltip
                  :content="'综合退货率'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>
              <!-- <div v-if="biNumberOfItem == null">未更新</div> v-else-->

              <div class="card-panel-num">
                {{
                  itemData.comprehensiveReturnRate
                    ? itemData.comprehensiveReturnRate + "%"
                    : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>

        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('总销售件数') }"
            @click="handleSetLineChartData('总销售件数')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                总销售件数
                <el-tooltip
                  :content="'总销售件数'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>
              <!-- <div v-if="biNumberOfItem == null">未更新</div> v-else-->

              <div class="card-panel-num">
                {{
                  itemData.totalSalesNumber
                    ? itemData.totalSalesNumber
                    : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('净销售件数') }"
            @click="handleSetLineChartData('净销售件数')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                净销售件数
                <el-tooltip
                  :content="'净销售件数'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>
              <div class="card-panel-num">
                {{
                  itemData.netSalesNumber ? itemData.netSalesNumber : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <!-- <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('毛利额') }"
            @click="handleSetLineChartData('毛利额')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                毛利额
                <el-tooltip
                  :content="'毛利额'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>
              <div class="card-panel-num">
                {{ itemData.grossProfit ? itemData.grossProfit : "未更新" }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>

        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('毛利率') }"
            @click="handleSetLineChartData('毛利率')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                毛利率
                <el-tooltip
                  :content="'毛利率'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>
              <div class="card-panel-num">
                {{
                  itemData.grossProfitRate
                    ? (itemData.grossProfitRate * 100).toFixed(2) + "%"
                    : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col> -->
        <!-- <el-col
          :xs="12"
          :sm="12"
          :lg="3"
          class="card-panel-col"
          v-for="(item, index) in biNumberItem.slice(0, 8)"
          :key="index"
        >
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes(item.name) }"
            @click="handleSetLineChartData(item.name)"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                
                {{ item.name }}
                <el-tooltip
                  :content="item.dataDetail"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>
              <div v-if="item.value == null" class="card-panel-num">未更新</div>
              <div v-else>
                
                <count-to
                  :start-val="0"
                  v-if="item.name.includes('数')"
                  :end-val="item.value"
                  :duration="duration"
                  class="card-panel-num"
                />
                <count-to
                  :start-val="0"
                  v-else-if="item.name.includes('率')"
                  :decimals="2"
                  :end-val="item.value"
                  :duration="duration"
                  class="card-panel-num"
                />
                <count-to
                  :start-val="0"
                  v-else
                  :end-val="item.value"
                  :duration="duration"
                  class="card-panel-num"
                />
                <span v-show="item.name.includes('综合退货率')">%</span>
              </div>
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">环比</div>
                <div class="card-panel-num">
                  <i class="el-icon-caret-top" v-if="item.chainSign == true" />
                  <i
                    class="el-icon-caret-bottom"
                    v-else-if="item.chainSign == false"
                  />
                  <count-to
                    :start-val="0"
                    :decimals="2"
                    v-if="item.chain !== null"
                    :end-val="item.chain"
                    :duration="duration"
                  />
                  <span v-if="item.chain == null">-</span>%
                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">同比</div>
                <div class="card-panel-num">
                  <i class="el-icon-caret-top" v-if="item.yoySign == true" />
                  <i
                    class="el-icon-caret-bottom"
                    v-else-if="item.yoySign == false"
                  />
                  <count-to
                    :start-val="0"
                    :decimals="2"
                    v-if="item.yoy !== null"
                    :end-val="item.yoy"
                    :duration="duration"
                  />
                  <span v-if="item.yoy == null">-</span>%
                </div>
              </div>
            </div>
          </div>
        </el-col> -->

        <!-- <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('退款金额') }"
            @click="handleSetLineChartData('退款金额')">
            <div class="card-panel-icon-wrapper icon-message">
              <svg-icon icon-class="message" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                退款金额
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.returnAmount" :duration="3000"
                class="card-panel-num" />
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('净销售额') }"
            @click="handleSetLineChartData('净销售额')">
            <div class="card-panel-icon-wrapper icon-money">
              <svg-icon icon-class="money" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                净销售额
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.netSalesAmount" :duration="3200"
                class="card-panel-num" />
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('综合退货率') }"
            @click="handleSetLineChartData('综合退货率')">
            <div class="card-panel-icon-wrapper icon-shopping">
              <svg-icon icon-class="shopping" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                综合退货率
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.comprehensiveReturnRate" :duration="3600"
                class="card-panel-num" />%
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col>

        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('发货前退货率') }"
            @click="handleSetLineChartData('发货前退货率')">
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                发货前退货率
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.returnBeforeShipmentRate" :duration="2600"
                class="card-panel-num" />%
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>

          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('发货后退货率') }"
            @click="handleSetLineChartData('发货后退货率')">
            <div class="card-panel-icon-wrapper icon-money">
              <svg-icon icon-class="money" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                发货后退货率
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.returnAfterShipmentRate" :duration="3200"
                class="card-panel-num" />%
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('订单数量') }"
            @click="handleSetLineChartData('订单数量')">
            <div class="card-panel-icon-wrapper icon-shopping">
              <svg-icon icon-class="shopping" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                订单数量
              </div>
              <count-to :start-val="0" :end-val="biNumberItem.totalOrdersNumber" :duration="3600"
                class="card-panel-num" />
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col>

        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('商品销售件数') }"
            @click="handleSetLineChartData('商品销售件数')">
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                商品销售件数
              </div>
              <count-to :start-val="0" :end-val="biNumberItem.totalSoldNumber" :duration="2600" class="card-panel-num" />
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>

          </div>
        </el-col> -->
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('发货前退货数') }"
            @click="handleSetLineChartData('发货前退货数')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text" style="font-size: 13.5px">
                发货前退货数
                <el-tooltip
                  :content="'发货前退货数'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{
                  itemData.returnBeforeShipmentNumber
                    ? itemData.returnBeforeShipmentNumber
                    : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('发货后退货数') }"
            @click="handleSetLineChartData('发货后退货数')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text" style="font-size: 13.5px">
                发货后退货数
                <el-tooltip
                  :content="'发货后退货数'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{
                  itemData.returnAfterShipmentNumber
                    ? itemData.returnAfterShipmentNumber
                    : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('总退货件数') }"
            @click="handleSetLineChartData('总退货件数')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                总退货件数
                <el-tooltip
                  :content="'总退货件数'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{
                  itemData.totalReturnNumber
                    ? itemData.totalReturnNumber
                    : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('库存') }"
            @click="handleSetLineChartData('库存')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                库存
                <el-tooltip :content="'库存'" effect="light" placement="bottom">
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{
                  itemData.endingInventory ? itemData.endingInventory : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('商品折扣率') }"
            @click="handleSetLineChartData('商品折扣率')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                商品折扣率
                <el-tooltip
                  :content="'商品折扣率'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{
                  itemData.discountRateGoods
                    ? itemData.discountRateGoods
                    : "未更新"
                }}%
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('总花费') }"
            @click="handleSetLineChartData('总花费')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                总花费
                <el-tooltip
                  :content="'总花费'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{ itemData.cost }}
                <!-- ? itemData.sdNumber : "未更新" -->
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('总成交金额') }"
            @click="handleSetLineChartData('总成交金额')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                总成交金额
                <el-tooltip
                  :content="'总成交金额'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{ itemData.totalFinishAmount }}
                <!--  ? itemData.mjxNumber : "未更新"  -->
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('售罄率') }"
            @click="handleSetLineChartData('售罄率')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                售罄率
                <el-tooltip
                  :content="'售罄率'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{
                  itemData.exhaustionRate
                    ? (itemData.exhaustionRate * 100).toFixed(2) + "%"
                    : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('可售天数') }"
            @click="handleSetLineChartData('可售天数')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                可售天数
                <el-tooltip
                  :content="'可售天数'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{ itemData.saleDays ? itemData.saleDays : "未更新" }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('可售月数') }"
            @click="handleSetLineChartData('可售月数')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                可售月数
                <el-tooltip
                  :content="'可售月数'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{
                  itemData.saleDays
                    ? (itemData.saleDays / 30).toFixed(2)
                    : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('采购在途') }"
            @click="handleSetLineChartData('采购在途')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                采购在途
                <el-tooltip
                  :content="'采购在途'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{
                  itemData.salesGrossProfit
                    ? itemData.salesGrossProfit
                    : "未更新"
                }}
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('SD单件数') }"
            @click="handleSetLineChartData('SD单件数')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                SD单件数
                <el-tooltip
                  :content="'SD单件数'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{ itemData.sdNumber }}
                <!-- ? itemData.sdNumber : "未更新" -->
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes('MJX单件数') }"
            @click="handleSetLineChartData('MJX单件数')"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                MJX单件数
                <el-tooltip
                  :content="'MJX单件数'"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>

              <div class="card-panel-num">
                {{ itemData.mjxNumber }}
                <!--  ? itemData.mjxNumber : "未更新"  -->
              </div>
            </div>
            <div class="card-panel-right" style="display: none"></div>
          </div>
        </el-col>
      </el-carousel-item>
      <!-- <el-carousel-item> -->
      <!-- <el-col
          :xs="12"
          :sm="12"
          :lg="3"
          class="card-panel-col"
          v-for="(item, index) in biNumberItem.slice(8, 15)"
          :key="index + 8"
        >
          <div
            class="card-panel"
            :class="{ highlight: highlighted.includes(item.name) }"
            @click="handleSetLineChartData(item.name)"
          >
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                
                {{ item.name }}
                <el-tooltip
                  :content="item.dataDetail"
                  effect="light"
                  placement="bottom"
                >
                  <svg-icon size="small" icon-class="question" />
                </el-tooltip>
              </div>
              <div v-if="item.value == null" class="card-panel-num">未更新</div>
              <div v-else>
                
                <count-to
                  :start-val="0"
                  v-if="item.name.includes('数')"
                  :end-val="item.value"
                  :duration="duration"
                  class="card-panel-num"
                />
                <count-to
                  :start-val="0"
                  v-else-if="item.name.includes('率')"
                  :decimals="2"
                  :end-val="item.value"
                  :duration="duration"
                  class="card-panel-num"
                />
                <count-to
                  :start-val="0"
                  v-else
                  :end-val="item.value"
                  :duration="duration"
                  class="card-panel-num"
                /><span v-show="item.name.includes('平均销售毛利率')">%</span>
              </div>
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">环比</div>
                <div class="card-panel-num">
                  <i class="el-icon-caret-top" v-if="item.chainSign == true" />
                  <i
                    class="el-icon-caret-bottom"
                    v-else-if="item.chainSign == false"
                  />
                  <count-to
                    :start-val="0"
                    :decimals="2"
                    v-if="item.chain !== null"
                    :end-val="item.chain"
                    :duration="duration"
                  />
                  <span v-if="item.chain == null">-</span>%
                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">同比</div>
                <div class="card-panel-num">
                  <i class="el-icon-caret-top" v-if="item.yoySign == true" />
                  <i
                    class="el-icon-caret-bottom"
                    v-else-if="item.yoySign == false"
                  />
                  <count-to
                    :start-val="0"
                    :decimals="2"
                    v-if="item.yoy !== null"
                    :end-val="item.yoy"
                    :duration="duration"
                  />
                  <span v-if="item.yoy == null">-</span>%
                </div>
              </div>
            </div>
          </div>
        </el-col> -->
      <!--  -->

      <!-- <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('销售毛利') }"
            @click="handleSetLineChartData('销售毛利')">
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                销售毛利
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.salesGrossProfit" :duration="2600"
                class="card-panel-num" />
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>

          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('连带率') }"
            @click="handleSetLineChartData('连带率')">
            <div class="card-panel-icon-wrapper icon-message">
              <svg-icon icon-class="message" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                连带率
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.jointSeveralRate" :duration="3000"
                class="card-panel-num" />%
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('客单价') }"
            @click="handleSetLineChartData('客单价')">
            <div class="card-panel-icon-wrapper icon-money">
              <svg-icon icon-class="money" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                客单价
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.customerUnitPrice" :duration="3200"
                class="card-panel-num" />
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('货单价') }"
            @click="handleSetLineChartData('货单价')">
            <div class="card-panel-icon-wrapper icon-shopping">
              <svg-icon icon-class="shopping" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                货单价
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.unitPrice" :duration="3600"
                class="card-panel-num" />
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col>

        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('商品货单价') }"
            @click="handleSetLineChartData('商品货单价')">
            <div
              class="card-panel-icon-wrapper icon-people"
              style="display: none"
            >
              <svg-icon icon-class="peoples" class-name="card-panel-icon" />
            </div>

            <div class="card-panel-description">
              <div class="card-panel-text">
                商品货单价
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.unitPriceGoods" :duration="2600"
                class="card-panel-num" />
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>

          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('配件货单价') }"
            @click="handleSetLineChartData('配件货单价')">
            <div class="card-panel-icon-wrapper icon-message">
              <svg-icon icon-class="message" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                配件货单价
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.accessoriesUnitPrice" :duration="3000"
                class="card-panel-num" />
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col> 
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('商品平均销售成本') }"
            @click="handleSetLineChartData('商品平均销售成本')">
            <div class="card-panel-icon-wrapper icon-money">
              <svg-icon icon-class="money" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                商品平均销售成本
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.averageCostSales" :duration="3200"
                class="card-panel-num" />
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="3" class="card-panel-col">
          <div class="card-panel" :class="{ 'highlight': highlighted.includes('平均销售毛利率') }"
            @click="handleSetLineChartData('平均销售毛利率')">
            <div class="card-panel-icon-wrapper icon-money">
              <svg-icon icon-class="money" class-name="card-panel-icon" />
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                平均销售毛利率
              </div>
              <count-to :start-val="0" :decimals="2" :end-val="biNumberItem.averageSalesGrossProfit" :duration="3200"
                class="card-panel-num" />%
            </div>
            <div class="card-panel-right">
              <div class="flex">
                <div class="card-panel-text">
                  环比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>
              <div class="flex">
                <div class="card-panel-text">
                  同比
                </div>
                <div class="card-panel-num">
                  <i class=" el-icon-caret-bottom" />
                  <span>12.5%</span>

                </div>
              </div>

            </div>
          </div>
        </el-col>-->
      <!-- </el-carousel-item> -->
    </el-carousel>
  </el-row>
</template>

<script>
import CountTo from "vue-count-to";

export default {
  components: {
    CountTo,
  },
  model: {
    prop: "biNumberItem",
  },
  props: {
    biNumberItem: {
      type: Array,
      default: () => [],
    },
    itemData: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      duration: 1000,
      highlighted: ["销售金额", "退款金额", "净销售额"], // 初始化时，前两个元素高亮
    };
  },
  methods: {
    handleSetLineChartData(type) {
      // const m = ["messages", "shoppings"]
      if (this.highlighted.includes(type)) {
        return;
      }
      // 移除旧的高亮元素
      this.highlighted.shift();
      // 添加新的高亮元素
      this.highlighted.push(type);

      console.log(JSON.stringify(this.highlighted));
      this.$emit("handleSetLineChartData", type);
    },
  },
};
</script>

<style lang="scss">
.el-carousel__indicator--horizontal {
  display: none;
}

.highlight {
  border-top: 5px solid #36a3f7;
}

i.el-icon-caret-top::before {
  color: #ff0000;
  /* 这将把颜色改为红色 */
}

i.el-icon-caret-bottom::before {
  color: green;
  /* 这将把颜色改色 */
}

//上三角
.increase {
  width: 10px;
  height: 10px;
  border-width: 3px;
  border-color: transparent transparent red transparent;
  border-style: solid;
  margin: 0 0 3px 5px;
}

//下三角
.decrease {
  width: 10px;
  height: 10px;
  border-width: 3px;
  border-color: green transparent transparent transparent;
  border-style: solid;
  margin: 3px 0 0 5px;
}

.panel-group {
  margin-top: 18px;

  .card-panel-col {
    margin-bottom: 32px;
  }

  .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
    border-radius: 15px;
    // border-color: rgba(0, 0, 0, .05);

    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }

      .icon-people {
        background: #40c9c6;
      }

      .icon-message {
        background: #36a3f7;
      }

      .icon-money {
        background: #f4516c;
      }

      .icon-shopping {
        background: #34bfa3;
      }
    }

    .icon-people {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-money {
      color: #f4516c;
    }

    .icon-shopping {
      color: #34bfa3;
    }

    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      float: left;
      font-size: 48px;
    }

    .card-panel-description {
      float: left;

      font-weight: bold;
      margin: 26px;
      margin-left: 10px;

      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 14px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 20px;
      }
    }

    .card-panel-right {
      float: right;
      // text-align: center;
      font-weight: bold;
      margin: 26px;
      margin-right: 10px;

      .flex {
        display: flex;
      }

      .card-panel-text {
        text-align: center;
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 14px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 14px;
        display: flex;
        align-items: center;
        margin-bottom: 12px;
      }
    }
  }
}

@media (max-width: 550px) {
  .card-panel-description {
    display: none;
  }

  .card-panel-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;

    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
</style>
